<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Doxygen: Eigen::PolynomialSolver&lt; _Scalar, 2 &gt; 模板类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Doxygen
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'搜索','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('class_eigen_1_1_polynomial_solver_3_01___scalar_00_012_01_4.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-types">Public 类型</a> &#124;
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="class_eigen_1_1_polynomial_solver_3_01___scalar_00_012_01_4-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">Eigen::PolynomialSolver&lt; _Scalar, 2 &gt; 模板类 参考</div>  </div>
</div><!--header-->
<div class="contents">
<div class="dynheader">
类 Eigen::PolynomialSolver&lt; _Scalar, 2 &gt; 继承关系图:</div>
<div class="dyncontent">
 <div class="center">
  <img src="class_eigen_1_1_polynomial_solver_3_01___scalar_00_012_01_4.png" alt=""/>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public 类型</h2></td></tr>
<tr class="memitem:a64e7dcfd1d13f8f39d8263fc156e3d59"><td class="memItemLeft" align="right" valign="top"><a id="a64e7dcfd1d13f8f39d8263fc156e3d59"></a>
typedef PolynomialSolverBase&lt; _Scalar, 2 &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>PS_Base</b></td></tr>
<tr class="separator:a64e7dcfd1d13f8f39d8263fc156e3d59"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:ac294bc51bec4762b7223c53eb5c12aeb"><td class="memTemplParams" colspan="2"><a id="ac294bc51bec4762b7223c53eb5c12aeb"></a>
template&lt;typename OtherPolynomial &gt; </td></tr>
<tr class="memitem:ac294bc51bec4762b7223c53eb5c12aeb"><td class="memTemplItemLeft" align="right" valign="top">&#160;</td><td class="memTemplItemRight" valign="bottom"><b>PolynomialSolver</b> (const OtherPolynomial &amp;poly, bool &amp;hasRealRoot)</td></tr>
<tr class="separator:ac294bc51bec4762b7223c53eb5c12aeb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7c5ae6f9542326a694813d966d4f5ecb"><td class="memTemplParams" colspan="2">template&lt;typename OtherPolynomial &gt; </td></tr>
<tr class="memitem:a7c5ae6f9542326a694813d966d4f5ecb"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="class_eigen_1_1_polynomial_solver_3_01___scalar_00_012_01_4.html#a7c5ae6f9542326a694813d966d4f5ecb">compute</a> (const OtherPolynomial &amp;poly, bool &amp;hasRealRoot)</td></tr>
<tr class="separator:a7c5ae6f9542326a694813d966d4f5ecb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6fca31a157dc6251f8f7a02c25163ad1"><td class="memTemplParams" colspan="2"><a id="a6fca31a157dc6251f8f7a02c25163ad1"></a>
template&lt;typename OtherPolynomial &gt; </td></tr>
<tr class="memitem:a6fca31a157dc6251f8f7a02c25163ad1"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><b>compute</b> (const OtherPolynomial &amp;poly)</td></tr>
<tr class="separator:a6fca31a157dc6251f8f7a02c25163ad1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">成员函数说明</h2>
<a id="a7c5ae6f9542326a694813d966d4f5ecb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7c5ae6f9542326a694813d966d4f5ecb">&#9670;&nbsp;</a></span>compute()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Scalar &gt; </div>
<div class="memtemplate">
template&lt;typename OtherPolynomial &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void Eigen::PolynomialSolver&lt; _Scalar, 2 &gt;::compute </td>
          <td>(</td>
          <td class="paramtype">const OtherPolynomial &amp;&#160;</td>
          <td class="paramname"><em>poly</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool &amp;&#160;</td>
          <td class="paramname"><em>hasRealRoot</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Computes the complex roots of a new polynomial. </p>
<div class="fragment"><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;      {</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;        <span class="keyword">const</span> Scalar ZERO(0);</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;        Scalar a2(2 * poly[2]);</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;        assert( ZERO != poly[poly.size()-1] );</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;        Scalar discriminant ((poly[1] * poly[1]) - (4 * poly[0] * poly[2]));</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;        <span class="keywordflow">if</span> (ZERO &lt; discriminant)</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;        {</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;          Scalar discriminant_root (std::sqrt (discriminant));</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;          m_roots[0] = (-poly[1] - discriminant_root) / (a2) ;</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;          m_roots[1] = (-poly[1] + discriminant_root) / (a2) ;</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;          hasRealRoot = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;        }</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;        <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;          <span class="keywordflow">if</span> (ZERO == discriminant)</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;          {</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;            m_roots.resize (1);</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;            m_roots[0] = -poly[1] / a2;</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;            hasRealRoot = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;          }</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;          <span class="keywordflow">else</span></div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;          {</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;            Scalar discriminant_root (std::sqrt (-discriminant));</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;            m_roots[0] = RootType (-poly[1] / a2, -discriminant_root / a2);</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;            m_roots[1] = RootType (-poly[1] / a2,  discriminant_root / a2);</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;            hasRealRoot = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;          }</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;        }</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;      }</div>
</div><!-- fragment -->
</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>registration/include/pcl/registration/<a class="el" href="bfgs_8h_source.html">bfgs.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><b>Eigen</b></li><li class="navelem"><a class="el" href="class_eigen_1_1_polynomial_solver_3_01___scalar_00_012_01_4.html">PolynomialSolver&lt; _Scalar, 2 &gt;</a></li>
    <li class="footer">制作者 <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
